//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CAABBoxExt {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CAABBoxExt(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CAABBoxExt obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CAABBoxExt(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CAABBoxExt() {
    this(nelmiscJNI.new_CAABBoxExt__SWIG_0(), true);
  }

  public CAABBoxExt(CAABBox o) {
    this(nelmiscJNI.new_CAABBoxExt__SWIG_1(CAABBox.getCPtr(o), o), true);
  }

  public void setCenter(CVector center) {
    nelmiscJNI.CAABBoxExt_setCenter(swigCPtr, this, CVector.getCPtr(center), center);
  }

  public void setHalfSize(CVector hs) {
    nelmiscJNI.CAABBoxExt_setHalfSize(swigCPtr, this, CVector.getCPtr(hs), hs);
  }

  public void setSize(CVector s) {
    nelmiscJNI.CAABBoxExt_setSize(swigCPtr, this, CVector.getCPtr(s), s);
  }

  public void setMinMax(CVector bmin, CVector bmax) {
    nelmiscJNI.CAABBoxExt_setMinMax(swigCPtr, this, CVector.getCPtr(bmin), bmin, CVector.getCPtr(bmax), bmax);
  }

  public CAABBoxExt assign(CAABBox o) {
    return new CAABBoxExt(nelmiscJNI.CAABBoxExt_assign(swigCPtr, this, CAABBox.getCPtr(o), o), false);
  }

  public CVector getMin() {
    return new CVector(nelmiscJNI.CAABBoxExt_getMin(swigCPtr, this), true);
  }

  public CVector getMax() {
    return new CVector(nelmiscJNI.CAABBoxExt_getMax(swigCPtr, this), true);
  }

  public CVector getCenter() {
    return new CVector(nelmiscJNI.CAABBoxExt_getCenter(swigCPtr, this), false);
  }

  public CVector getHalfSize() {
    return new CVector(nelmiscJNI.CAABBoxExt_getHalfSize(swigCPtr, this), false);
  }

  public CVector getSize() {
    return new CVector(nelmiscJNI.CAABBoxExt_getSize(swigCPtr, this), true);
  }

  public float getRadius() {
    return nelmiscJNI.CAABBoxExt_getRadius(swigCPtr, this);
  }

  public CAABBox getAABBox() {
    return new CAABBox(nelmiscJNI.CAABBoxExt_getAABBox(swigCPtr, this), true);
  }

  public boolean clipFront(CPlane p) {
    return nelmiscJNI.CAABBoxExt_clipFront(swigCPtr, this, CPlane.getCPtr(p), p);
  }

  public boolean clipBack(CPlane p) {
    return nelmiscJNI.CAABBoxExt_clipBack(swigCPtr, this, CPlane.getCPtr(p), p);
  }

  public boolean intersect(CAABBoxExt box) {
    return nelmiscJNI.CAABBoxExt_intersect__SWIG_0(swigCPtr, this, CAABBoxExt.getCPtr(box), box);
  }

  public boolean intersect(CVector a, CVector b, CVector c) {
    return nelmiscJNI.CAABBoxExt_intersect__SWIG_1(swigCPtr, this, CVector.getCPtr(a), a, CVector.getCPtr(b), b, CVector.getCPtr(c), c);
  }

  public void serial(IStream f) {
    nelmiscJNI.CAABBoxExt_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

}
